//
//	ZcoModelUa.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelUa.h"

NSString *const kZcoModelUaBrowser = @"browser";
NSString *const kZcoModelUaCpu = @"cpu";
NSString *const kZcoModelUaDevice = @"device";
NSString *const kZcoModelUaEngine = @"engine";
NSString *const kZcoModelUaOs = @"os";
NSString *const kZcoModelUaUa = @"ua";

@interface ZcoModelUa ()
@end
@implementation ZcoModelUa




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelUaBrowser] isKindOfClass:[NSNull class]]){
		self.browser = [[ZcoModelBrowser alloc] initWithDictionary:dictionary[kZcoModelUaBrowser]];
	}

	if(![dictionary[kZcoModelUaCpu] isKindOfClass:[NSNull class]]){
		self.cpu = [[ZcoModelCpu alloc] initWithDictionary:dictionary[kZcoModelUaCpu]];
	}

	if(![dictionary[kZcoModelUaDevice] isKindOfClass:[NSNull class]]){
		self.device = [[ZcoModelDevice alloc] initWithDictionary:dictionary[kZcoModelUaDevice]];
	}

	if(![dictionary[kZcoModelUaEngine] isKindOfClass:[NSNull class]]){
		self.engine = [[ZcoModelEngine alloc] initWithDictionary:dictionary[kZcoModelUaEngine]];
	}

	if(![dictionary[kZcoModelUaOs] isKindOfClass:[NSNull class]]){
		self.os = [[ZcoModelEngine alloc] initWithDictionary:dictionary[kZcoModelUaOs]];
	}

	if(![dictionary[kZcoModelUaUa] isKindOfClass:[NSNull class]]){
		self.ua = dictionary[kZcoModelUaUa];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.browser != nil){
		dictionary[kZcoModelUaBrowser] = [self.browser toDictionary];
	}
	if(self.cpu != nil){
		dictionary[kZcoModelUaCpu] = [self.cpu toDictionary];
	}
	if(self.device != nil){
		dictionary[kZcoModelUaDevice] = [self.device toDictionary];
	}
	if(self.engine != nil){
		dictionary[kZcoModelUaEngine] = [self.engine toDictionary];
	}
	if(self.os != nil){
		dictionary[kZcoModelUaOs] = [self.os toDictionary];
	}
	if(self.ua != nil){
		dictionary[kZcoModelUaUa] = self.ua;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.browser != nil){
		[aCoder encodeObject:self.browser forKey:kZcoModelUaBrowser];
	}
	if(self.cpu != nil){
		[aCoder encodeObject:self.cpu forKey:kZcoModelUaCpu];
	}
	if(self.device != nil){
		[aCoder encodeObject:self.device forKey:kZcoModelUaDevice];
	}
	if(self.engine != nil){
		[aCoder encodeObject:self.engine forKey:kZcoModelUaEngine];
	}
	if(self.os != nil){
		[aCoder encodeObject:self.os forKey:kZcoModelUaOs];
	}
	if(self.ua != nil){
		[aCoder encodeObject:self.ua forKey:kZcoModelUaUa];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.browser = [aDecoder decodeObjectForKey:kZcoModelUaBrowser];
	self.cpu = [aDecoder decodeObjectForKey:kZcoModelUaCpu];
	self.device = [aDecoder decodeObjectForKey:kZcoModelUaDevice];
	self.engine = [aDecoder decodeObjectForKey:kZcoModelUaEngine];
	self.os = [aDecoder decodeObjectForKey:kZcoModelUaOs];
	self.ua = [aDecoder decodeObjectForKey:kZcoModelUaUa];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelUa *copy = [ZcoModelUa new];

	copy.browser = [self.browser copy];
	copy.cpu = [self.cpu copy];
	copy.device = [self.device copy];
	copy.engine = [self.engine copy];
	copy.os = [self.os copy];
	copy.ua = [self.ua copy];

	return copy;
}
@end